<%--
  Created by IntelliJ IDEA.
  User: Master
  Date: 2022/12/5
  Time: 10:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="javascript" src="/js/jquery-3.6.1.min.js"></script>
</head>
<body>
<form action="/login" method="get">
    <input type="text" name="username" value="${cookie.username.value}" placeholder="请输入用户名">
    <input type="password" name="password" value="${cookie.password.value}" placeholder="请输入用密码">
    <input type="text" name="code" placeholder="请输入用验证码">
    <img src="/code" id="code" onclick="getCode(this)">
    <%--    <a href="login.jsp">点击刷新验证码</a>--%>
    记住密码:<input type="checkbox" name="remember" value="1">
    <input type="submit" value="提交">
</form>
</body>
</html>
<script>
    function getCode(obj) {
        // $(obj).attr('src', '/code?aa=' + new Date())
        document.getElementById("code").src='/code?aa=' + new Date();
    }
</script>